package services
{
   import ScriptsGenericos.Sesion;
   
   import mx.controls.Alert;
   import mx.messaging.ChannelSet;
   import mx.messaging.channels.AMFChannel;
   import mx.rpc.events.FaultEvent;
   import mx.rpc.remoting.mxml.RemoteObject;

   public class GenericService extends RemoteObject
   {
      public function GenericService()
      {
        super();
        var channel:ChannelSet=new ChannelSet();
        var amfChannel:AMFChannel=new AMFChannel("my-amf", "http://localhost:8080/Server/messagebroker/amf");
        //var amfChannel:AMFChannel=new AMFChannel("my-amf", Sesion._channelSet.toString());
        channel.addChannel(amfChannel);
        this.channelSet=channel;
        this.addEventListener(FaultEvent.FAULT,onFault);
       }
              
       public function onFault(event:FaultEvent):void
       {                  
          Alert.show( "Error comunicando con "+this.destination+" \nDetalle:"+event.fault.message);         
       }
            
    }
}